# 每天21时间10分清理用户数据
import datetime
import os

from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.schedulers.blocking import BlockingScheduler


def clean():
    for i in os.listdir('./data'):
        os.remove(os.path.join('./data', i))
    with open('count', 'w', encoding='utf-8') as f:
        f.write(str(dict()))
    print('cleand...')


if __name__ == '__main__':
    scheduler = BlockingScheduler()
    scheduler.add_job(clean, 'cron', hour='21', minute='10', second='00')
    scheduler.start()
